@use '@angular/material' as mat;

@mixin color($config-or-theme) {
  $config: mat.get-color-config($config-or-theme);
  $background: map-get($config, background);
  $foreground: map-get($config, foreground);

  .mat-tab-group {
    .mat-tab-header {
      .mat-ink-bar {
        height: 6px;
        border-radius: 3px;
      }
      .mat-tab-label {
        height: 2.5rem;
      }
    }

    &:not(.mat-tab-group-inverted-header) {
      .mat-tab-header {
        border-bottom: 1px solid mat.get-color-from-palette($foreground, divider);
        .mat-ink-bar {
          position: absolute;
          bottom: -3px;
          top: auto;
        }
      }
    }
  }

  .mat-tab-group-inverted-header .mat-tab-header .mat-ink-bar {
    top: -3px;
    bottom: 0;
  }
}

@mixin density($config-or-theme) {
  .ngm-breadcrumb-bar.ngm-density__compact {
    .breadcrumb.mat-tab-header .mat-ink-bar {
      bottom: -3px;
    }
  }
}

@mixin typography($config-or-theme) {
}

@mixin theme($theme) {
  $color: mat.get-color-config($theme);
  $density: mat.get-density-config($theme);
  $typography: mat.get-typography-config($theme);

  @if $color != null {
    @include color($color);
  }
  @if $density != null {
    @include density($density);
  }
  @if $typography != null {
    @include typography($typography);
  }
}
